package org.bluweb.g4wicket;

import org.apache.wicket.behavior.AttributeAppender;
import org.apache.wicket.markup.html.WebComponent;
import org.apache.wicket.model.Model;

@SuppressWarnings("serial")
public class G4WicketImage extends WebComponent {

	private int height;
	private int width;
	
	public G4WicketImage( String id, int width, int height ) {
		super( id );
		this.height = height;
		this.width = width;
	}

	public int getHeight() {
		return height;
	}

	public int getWidth() {
		return width;
	}
	
	protected void execute( String script, G4WicketEvent event ) {

		event.getComponent().add(new AttributeAppender( event.getEvent(), new Model<String>( script ), ";"));		
	}	
}
